package auctioncentral;

import java.util.ArrayList;
import java.util.List;

/**
 * The BiddingUser class represents registered bidder user profiles within the 
 * AuctionCentral System.
 * 
 * @author Andres Rosales (acr)
 * @version 02/26/2014 acr
 */
public class BiddingUser extends AbstractUser {
	
//	/**
//	 * A list of Strings representing the user's payment information.
//	 */
//	private List<String> my_payment_info = new ArrayList<String>();
	
	/**
	 * credit card number.
	 */
	private String my_card_number;
	
	/**
	 * billing address.
	 */
	private String my_billing_address;
	
	/**
	 * A list of the user's current bids.
	 */
	private List<Bid> my_bids = new ArrayList<Bid>();
	
	/**
	 * Constructs and initializes a new instance of the BiddingUser class.
	 * 
	 * @param the_name The user's name.
	 * @param the_add The user's address.
	 * @param the_num The user's phone number.
	 * @param the_credit_card the users credit card number.
	 * @param the_billing_address the users billing address for the credit card.
	 */
	public BiddingUser(String the_name, String the_add, String the_num, String the_credit_card, String the_billing_address) {
		super(the_name, the_add, the_num);
		my_card_number = the_credit_card;
		my_billing_address = the_billing_address;
	}

//	/**
//	 * Returns the user's payment information.
//	 * 
//	 * @return The user's payment information.
//	 */
//	public List<String> getPaymentInfo() {
//		return my_payment_info;
//	}
	
	/**
	 * Returns the user's list of current bids.
	 * 
	 * @return The user's list of current bids.
	 */
	public List<Bid> getBids() {
		return my_bids;
	}	
	
//	/**
//	 * Sets the user's payment info to the given info.
//	 * @param the_info The info to be set as the payment info.
//	 */
//	public void setPaymentInfo(final List<String> the_info) {
//		my_payment_info = the_info;
//	}
	
	/**
	 * Adds the given bid into the user's list of current bids.
	 * <dt><b>Precondition:</b><dd> The user's has entered a bid that is not contained within their list of bids.
	 * <dt><b>Postcondition:</b><dd> The user's list of bids contains the entered bid.
	 * @param the_bid The bid to be added to the list of bids.
	 */
	public void placeBid(Bid the_bid) {
		my_bids.add(the_bid);
	}
	
	/**
	 * Returns the billing address of this user.
	 * 
	 * @return The billing address of this user.
	 */
	public String getBillingAddress() {
		return my_billing_address;
	}

	/**
	 * Returns this user's card number.
	 * 
	 * @return this user's card number.
	 */
	public String getCardNo() {
		return my_card_number;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
	  String s = my_name + " " + my_add + " " + my_num + " " +  my_card_number + " " + my_billing_address;
	  
	  return s;
	}
}
